<?php

namespace App\Http\Requests\Api;

class GroupCourseOrderRequest extends FormRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        switch ($this->method()) {
            case 'GET':
            {
                return [
                    'id' => ['required', 'exists:shop_user,id'],
                ];
            }
            case 'POST':
            {
                return [
                    'group_course_id' => ['required', 'exists:group_courses,id'],
                ];
            }
            default:
            {
                return [

                ];
            }
        }
    }

    public function messages()
    {
        return [
            'group_course_id.required'=>'团课ID不能为空',
            'group_course_id.exists'=>'团课ID不存在',
        ];
    }
}
